<template>
  <div id="app">
    <el-container>
      <el-header>
        <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
        >
          <el-menu-item index="1">
            <router-link to="/">首页</router-link>
          </el-menu-item>
          <el-menu-item index="2">
            <router-link to="/users">用户管理</router-link>
          </el-menu-item>
          <el-menu-item index="3">
            <router-link to="/areas">区域管理</router-link>
          </el-menu-item>
          <el-menu-item index="4">
            <router-link to="/cleaners">保洁管理</router-link>
          </el-menu-item>
          <el-menu-item index="5">
            <router-link to="/tasks">任务管理</router-link>
          </el-menu-item>
        </el-menu>
      </el-header>
      
      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const activeIndex = ref('1')

const handleSelect = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}

.el-header {
  padding: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

.router-link-active {
  color: inherit;
}
</style>